﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Catering.View_Operaction;
using Microsoft.Reporting.WebForms;
using System.Data;

namespace Catering.Catering_Page.Kufang
{
    public partial class CostDataPersonAvgChar : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {

            }
        }

        protected void LinkButton1_Click(object sender, EventArgs e)
        {
            View_Monitor vm = new View_Monitor();
            if (string.IsNullOrEmpty(DDLTool1.GetDDL_Area()) || string.IsNullOrEmpty(DDLTool1.GetDDL_Class()))
            {
                //tdMes.Style["display"] = "block";
                //lblMes.Text = "请选择查询条件，查询所有请选择全部。";
                return;
            }
            else
            {
                //tdMes.Style["display"] = "none";
                //lblMes.Text = "";
            }
            if (string.IsNullOrEmpty(DDLTool1.GetYear())) return;
            string pid = "0";
            if (Session["UserID"] != null) pid = Session["UserID"].ToString();
            DataTable dt = vm.GetCostDataPersonAvg(pid, DDLTool1.GetDDL_Area(), DDLTool1.GetDDL_Class(), DateTime.Parse(DDLTool1.GetYear() + "-01"),false);
            ReportDataSource rds = new ReportDataSource("DataSet1", dt);
            ReportViewer1.LocalReport.DataSources.Clear();
            ReportViewer1.LocalReport.DataSources.Add(rds);
            ReportViewer1.LocalReport.Refresh();
            ReportViewer1.Visible = true;
        }
    }
}